<?php
/**
 * Created by Shijie Liu. 2017/3/3
 * 将数据存取到文件中
 */
    include "SpiderMain.php";

    set_time_limit(0);

    $test = new SpiderMain();
//
    file_put_contents("../data.txt","");  //清除旧的信息
    $whu_lec = $test->main();

    for ($id = 0;$id < count($whu_lec);$id++){
        $line =  ($id+1)."#".$whu_lec[$id]["title"]."#".$whu_lec[$id]["date"]."#".$whu_lec[$id]["url"];
        file_put_contents("../data.txt",$line."\n",FILE_APPEND);
    }